-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ADI MAX32690 microcontroller #9667
base: main
Are you sure you want to change the base?
Conversation
…ent/unstub, but builds clean.
…into port/max32690
- Added simple status LED for initial testing - Generally cleaned up & implemented supervisor/port.c - Added some additional commenting from supervisor headers - Fixed a linkerscript issue copying .text into FLASH_ISR
- (build): added hex & bin targets for executable. - (build): temporarily modified .ld due to issue exiting MAX32 ROM code - (flash): added flash target for jlink & msdk, along with helper files under tools/ - Reorganized mpconfigport.mk for clarity - Moved flash driver & LED/PB definitions to board files (mpconfigboard._)
…Placed in supervisor/port.c - Moved LEDs & PBs from supervisor/port.c to boards/$(BOARD)/board.c for APARD - Reviewed Processor.c in common-hal/microcontroller - Prepared stubs for common-hal/microcontroller/Pin.c
…. - Enabled USB-based modules & dependencies in mpconfigport.mk
…umerates but has some issues starting interfaces for CDC/MSC/HID.
…be usable. - Had to adjust some shared modules to account for MAX32 devices not supporting IN/OUT endpoints on the same EP #
… Fixed bugs with Internal Flash filesystem. Files now write & read back correctly. - Added copyright headers for all files.
…h in microcontroller/Pin.c
…into port/max32690
…re. Added priority to remaining TODOs (low)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new port! I'm excited to try it. I've added a few comments. Nothing major.
// todo (low): MSDK Hardware does not support open-drain configuration except | ||
// todo (low): when directly managed by a peripheral such as I2C. | ||
// todo (low): find a way to signal this to any upstream code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code in this file can implement open drain itself by switching the output buffer off and on. Here is the SAMD code:
circuitpython/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
Lines 77 to 96 in ec5cca6
void common_hal_digitalio_digitalinout_set_value( | |
digitalio_digitalinout_obj_t *self, bool value) { | |
const uint8_t pin = self->pin->number; | |
const uint8_t port = GPIO_PORT(pin); | |
const uint32_t pin_mask = 1U << GPIO_PIN(pin); | |
if (value) { | |
if (self->open_drain) { | |
// Assertion: pull is off, so the pin is floating in this case. | |
// We do open-drain high output (no sinking of current) | |
// by changing the direction to input with no pulls. | |
hri_port_clear_DIR_DIR_bf(PORT, port, pin_mask); | |
} else { | |
hri_port_set_DIR_DIR_bf(PORT, port, pin_mask); | |
hri_port_set_OUT_OUT_bf(PORT, port, pin_mask); | |
} | |
} else { | |
hri_port_set_DIR_DIR_bf(PORT, port, pin_mask); | |
hri_port_clear_OUT_OUT_bf(PORT, port, pin_mask); | |
} | |
} |
…h interrupt_after_ticks. - Move LED inidcator to STATUS_LED code.
… GPIO Port 4 (different on MAX32690). - Added MCR defs to max32_port.h.
Description
Add support for 2 boards: MAX32690EVKIT and AD-APARD32690-SL.
Status
At the moment, this port only includes
digitalio
in addition to the supervisor and USB workflow required to get CircuitPython functioning. Pinouts listed are currently just the MCU pins; happy to change as needed to better match any requirements for form factor or pin function. I plan to follow this up with abusio
PR soon, but will be more tied up in the next couple months. Still happy to make changes as needed to this PR though.USB Endpoint Enumeration Change
There is a small important bit I had to change to the way CircuitPython handles settings up USB Endpoints:
Many thanks to @tannewt and @dhalbert for the help :)